<?php

namespace App\Admin\Controllers\Admin;

use App\Models\Tire;
use Encore\Admin\Controllers\AdminController;
use Encore\Admin\Form;
use Encore\Admin\Grid;
use Encore\Admin\Show;
use function __;

class TireController extends AdminController
{
    /**
     * Title for current resource.
     *
     * @var string
     */
    protected $title = '层级列表';

    /**
     * Make a grid builder.
     *
     * @return Grid
     */
    protected function grid()
    {
        $grid = new Grid(new Tire());

        $grid->column('id', __('Id'));
        $grid->column('name', __('层级名称'));
        $grid->column('index', __('层级索引'));
        $grid->actions(function($action){
            $action->disableView();
            $action->disableDelete();
        });
        return $grid;
    }


    /**
     * Make a form builder.
     *
     * @return Form
     */
    protected function form()
    {
        $form = new Form(new Tire());

        $form->text('name', __('层级名称'));
        $form->number('index', __('层级索引'));

        return $form;
    }
}
